The popularity of handheld electronic devices with camera capability (e.g., cell phones, digital cameras, etc.) has spawned numerous applications. Memory capacity is often very limited for these handheld devices so the images are typically compressed into either a lossless or a lossy compression format when stored. Lossless compression formats allow the exact original image to be reconstructed from the compressed image data. Examples of lossless formats include Graphics Interchange Format (GIF), Portable Network Graphics (PNG), and Tagged Image File Format (TIFF). Lossy compression formats compresses in a manner that allows a close but not exact rendition of the original image to be reconstructed from the compressed image data. An example of a lossy compression format is the Joint Photographic Experts Group (JPEG) format. Generally, lossy compression formats result in much smaller image data files than lossless compression formats. As a result, in certain applications where memory space is very restricted (i.e., handheld device), JPEG compression is the compression format of choice.
One inherent limitation that is common to all conventional JPEG compression methods is that there is no deterministic manner in which to ensure that maximum size limits for the compressed JPEG files are not exceeded. This is a particularly serious drawback for compression of highly complex images which tends to result in correspondingly large JPEG image files. The larger the JPEG image files the less number of images that the device can store, which adversely impacts the utility of a camera function on a handheld device with limited memory capacity.
In view of the forgoing, there is a need for a method, apparatus, and system to set and enforce maximum size limits for a JPEG file without unacceptably impacting the quality of the resulting image.